Optimal. Leaf size=76 \[ \frac {2 b^2 \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 d \sqrt {a-b} \sqrt {a+b}}-\frac {b x}{a^2}+\frac {\sin (c+d x)}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.10, antiderivative size = 76, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {3853, 12, 3783, 2659, 208} \[ \frac {2 b^2 \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 d \sqrt {a-b} \sqrt {a+b}}-\frac {b x}{a^2}+\frac {\sin (c+d x)}{a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 208
Rule 2659
Rule 3783
Rule 3853
Rubi steps
\begin {align*} \int \frac {\cos (c+d x)}{a+b \sec (c+d x)} \, dx &=\frac {\sin (c+d x)}{a d}-\frac {\int \frac {b}{a+b \sec (c+d x)} \, dx}{a}\\ &=\frac {\sin (c+d x)}{a d}-\frac {b \int \frac {1}{a+b \sec (c+d x)} \, dx}{a}\\ &=-\frac {b x}{a^2}+\frac {\sin (c+d x)}{a d}+\frac {b \int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx}{a^2}\\ &=-\frac {b x}{a^2}+\frac {\sin (c+d x)}{a d}+\frac {(2 b) \operatorname {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a^2 d}\\ &=-\frac {b x}{a^2}+\frac {2 b^2 \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 \sqrt {a-b} \sqrt {a+b} d}+\frac {\sin (c+d x)}{a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.15, size = 72, normalized size = 0.95 \[ \frac {-\frac {2 b^2 \tanh ^{-1}\left (\frac {(b-a) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}+a \sin (c+d x)-b (c+d x)}{a^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.49, size = 277, normalized size = 3.64 \[ \left [\frac {\sqrt {a^{2} - b^{2}} b^{2} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right ) - 2 \, {\left (a^{2} b - b^{3}\right )} d x + 2 \, {\left (a^{3} - a b^{2}\right )} \sin \left (d x + c\right )}{2 \, {\left (a^{4} - a^{2} b^{2}\right )} d}, \frac {\sqrt {-a^{2} + b^{2}} b^{2} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right ) - {\left (a^{2} b - b^{3}\right )} d x + {\left (a^{3} - a b^{2}\right )} \sin \left (d x + c\right )}{{\left (a^{4} - a^{2} b^{2}\right )} d}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.22, size = 126, normalized size = 1.66 \[ \frac {\frac {2 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )} b^{2}}{\sqrt {-a^{2} + b^{2}} a^{2}} - \frac {{\left (d x + c\right )} b}{a^{2}} + \frac {2 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )} a}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.64, size = 102, normalized size = 1.34 \[ \frac {2 b^{2} \arctanh \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{d \,a^{2} \sqrt {\left (a -b \right ) \left (a +b \right )}}+\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d a \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-\frac {2 b \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.31, size = 395, normalized size = 5.20 \[ \frac {a^3\,\sin \left (c+d\,x\right )}{d\,\left (a^4-a^2\,b^2\right )}+\frac {2\,b^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d\,\left (a^4-a^2\,b^2\right )}-\frac {a\,b^2\,\sin \left (c+d\,x\right )}{d\,\left (a^4-a^2\,b^2\right )}-\frac {2\,a^2\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d\,\left (a^4-a^2\,b^2\right )}+\frac {b^2\,\mathrm {atan}\left (\frac {-a^5\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,1{}\mathrm {i}+b^3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (a^2-b^2\right )}^{3/2}\,2{}\mathrm {i}+b^5\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,2{}\mathrm {i}-a^2\,b^3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,3{}\mathrm {i}+a^3\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,1{}\mathrm {i}+a^4\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^6-2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^4\,b^2+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b^4}\right )\,\sqrt {a^2-b^2}\,2{}\mathrm {i}}{d\,\left (a^4-a^2\,b^2\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\cos {\left (c + d x \right )}}{a + b \sec {\left (c + d x \right )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________